import Cookies from "js-cookie";

const REACT_APP_AUTH_TOKEN = "REACT_APP_AUTH_TOKEN";

export const setCookieToken = (token: string) => {
  Cookies.set(REACT_APP_AUTH_TOKEN, token, { path: "/", expires: 30 });
};

export const getCookieToken = () => {
  return Cookies.get(REACT_APP_AUTH_TOKEN);
};

export const removeCookieToken = () => {
  Cookies.remove(REACT_APP_AUTH_TOKEN);
};

export const setCookieValue = (key: string, value: any, expires?: number) => {
  Cookies.set(key, value, { path: "/", expires });
};

export const getCookieValue = (key: string) => {
  return Cookies.get(key);
};

export const removeCookieValue = (key: string) => {
  Cookies.remove(key);
};
